package com.md.api;

import com.md.base.request.IdRequest;
import com.md.model.page.PageResponse;
import com.md.model.system.CommonResult;
import com.md.request.LinkRoleRequest;
import com.md.request.QueryUsersPageRequest;
import com.md.request.RegisterUsersRequest;
import com.md.response.UsersDetailResponse;
import com.md.response.UsersResponse;
import com.md.value.constants.ApiConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author 刘骄阳
 * 2024-12-15 1:24
 */
@Api(tags = {ApiConstants.USERS})
public interface UsersApi {
  String PATH_PREFIX = "/api/users";

  @PostMapping(PATH_PREFIX + "/register")
  @ApiOperation("注册用户")
  CommonResult<UsersResponse> register(@RequestBody RegisterUsersRequest request);

  @PostMapping(PATH_PREFIX + "/check")
  @ApiOperation("校验参数是否正确")
  CommonResult<Void> checkUserFormat(@RequestBody RegisterUsersRequest request);

  @PostMapping(PATH_PREFIX + "/link-role")
  @ApiOperation("绑定角色")
  CommonResult<Void> linkRole(@RequestBody LinkRoleRequest request);

  @PostMapping(PATH_PREFIX + "/list")
  @ApiOperation("查询用户列表")
  CommonResult<PageResponse<UsersResponse>> list(@RequestBody QueryUsersPageRequest request);

  @PostMapping(PATH_PREFIX + "/detail")
  @ApiOperation("查询用户详情")
  CommonResult<UsersDetailResponse> detail(@RequestBody IdRequest request);

}
